package com.yygo.webapp.controller;

import com.yygo.util.MobileFromUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by tiansha on 2015/7/6.
 */
@Controller
@RequestMapping("/mobileValidate")
public class MobileController {

    @RequestMapping(method = RequestMethod.GET, produces="text/plain;charset=utf-8")
    @ResponseBody
    public String handleRequest(@RequestParam(required = false, value = "mobile") String mobile) throws Exception {
        String from = MobileFromUtil.getMobileAddress(mobile);
        return from;
    }
}
